package ltd.dujiabao.capability.common.utils;

import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/7 21:19
 * @Desc :
 */
public class DateUtils {
    /**
     * 将LocalDateTime转为秒级时间戳
     * @param localDateTime
     * @return
     */
    public static long toLongSecond(LocalDateTime localDateTime) {
        return localDateTime.atZone(ZoneId.systemDefault()).toInstant().getEpochSecond();
    }
}
